<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原型</title>
    <script>
        let Tank=function (color){
            this.color=color;
            this.fire=function (){
                console.log("开火")
            }
        }
        Tank.prototype.move=function (){
            console.log("移动");
        }
        let tank1=new Tank("white");
        let tank2=new Tank("white");
        console.log(tank1.fire===tank2.fire);
        console.log(tank1.move===tank2.move);
        Object.prototype.test=function (){
            console.log("测试");
        }
        tank1.test();
    </script>
</head>
<body>
    
</body>
</html>